std::stack::top

From Cppreference

Jump to: navigation, search
​reference top();

​const_reference top() const;

Returns reference to the top element in the stack. This is the most recently pushed element. This element will be removed on a call to pop(). Effectively calls ​c.back().

Contents

Parameters

(none)

Return value

reference to the last element

Complexity

constant

See also

push
inserts element at the top
(public member function)
pop
removes the first element
(public member function)
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox
In other languages